<?php
namespace console\controllers; 
use Yii;
use common\models\finance\StaticInstanceModel;
use common\models\trade\tradeModel;
use common\utils\CommonFun;
use common\models\finance\BalanceModel;
use common\models\platform\SettingModel;
use common\models\member\MemberModel;
use common\models\finance\EthTradeLogModel;
use common\models\trade\TradeRechargeModel;

use xtype\Ethereum\Client;
use xtype\Ethereum\Utils;

use common\bonus\BaseBonus;
use common\utils\Redis;
/*
	* 以太坊交易相关定时
*/
class TestController extends CoreController
{

	public function actionIndex()
	{
		$client = new Client(Yii::$app->params['eth']['infuraUrl']);
		$fromAddress = Yii::$app->params['eth']['address'];

		//实例化redis
   		$redis = Redis::getRedis(); 

   		## 检测nonce值 
		$nonce = $client->eth_getTransactionCount($fromAddress, 'pending');
        $nonce = Utils::hexToDec($nonce);  //十进制
   		$weNonce = $redis->hget('nonce_key','nonce');
		
		var_dump($nonce);
		var_dump($weNonce);die;    

	}

}